package com.yvtian.pu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yvtian.pu.pojo.PuReturnOrderItemEntity;
import com.yvtian.pu.dao.PuReturnOrderItemMapper;
import com.yvtian.pu.service.PuReturnOrderItemService;
import com.yvtian.utils.StringHelper;
import org.springframework.stereotype.Service;

/**
 * 采购退货单明细(pu_return_order_item)表服务实现类
 *
 * @author long
 * @since 2024-06-24 10:26:29
 */
@Service("puReturnOrderItemService")
public class PuReturnOrderItemServiceImpl extends ServiceImpl<PuReturnOrderItemMapper, PuReturnOrderItemEntity> implements PuReturnOrderItemService {

    @Override
    public IPage<PuReturnOrderItemEntity> findByPage(Page<PuReturnOrderItemEntity> page, PuReturnOrderItemEntity puReturnOrderItemEntity) {
        LambdaQueryWrapper<PuReturnOrderItemEntity> queryWrapper = new LambdaQueryWrapper<>();
        if (StringHelper.isNotEmpty(puReturnOrderItemEntity.getReturnCode())) {
            queryWrapper.eq(PuReturnOrderItemEntity::getReturnCode, puReturnOrderItemEntity.getReturnCode());
        }
        return this.page(page, queryWrapper);
    }
}

